package com.sc.pattern.future;

/**
 * Created  on 2018/1/7.
 *
 * @author sc
 */
public class Client {
    public static void main(String[] args) {
        FutureService futureService = new FutureService();
        Future<String> submit = futureService.submit(() -> {
            try {
                 Thread.sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            return "finish";
        },System.out::println );

        System.out.println("do something ");
        //System.out.println("future----"+submit.get());
        System.out.println("1231");
    }
    private static String get(){
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "finish";
    }
}
